<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>代理商信息修改</title>
	<%@ include file="/pages/common/common.jsp" %>		
	<link rel="stylesheet" type="text/css" href="${ctx}/css/register.css" />
	<script type="text/javascript">
	$(function(){
		$("#userPwd1").blur(function(){
			if($(this).val()==$("#npassword").val()){
			document.getElementById("passwordfail").style.display="none";
			} else {
			document.getElementById("passwordfail").style.display="";

			}
		});
		
		
		
	});
		
	/** 修改 */
	function update(){
		var r = $('#regForm').form('validate');
		if(!r) {
			return false;
		}
		var url="${ctx}/agentManage/pwd.action";
		
		$.post(url,$("#regForm").serializeArray(),function(data){
			//$('#regForm').form('clear');
			if(data.success){//操作成功
				$.messager.alert('提示','修改成功','info');
			}else{
				$.messager.alert('提示',data.msg,'warning');	
			}
		});
	}	
	function clearUp(){
		$('#regForm').form('clear');
	}
	</script>	
  </head>
  <body style="margin:0;padding:0;height:100%;overflow:scroll;background:#fff">
  <form class="auform" id="regForm" method="post">
  <input type="hidden" name="agent.agentId" value="${agent.agentId}"/>
  <input type="hidden" name="agent.agentsn" value="${agent.agentsn}"/>
  <div id="register_div">
  	<h2>代理商信息修改</h2>
	<div class="demo-info">
		<div class="demo-tip icon-tip"></div>
		<div></div>
	</div>
	<div class="info_div">
		<div class="info_title">代理商密码修改</div>
		<div class="info_content">
			<table>
				
				<tr>
				<td class="autd1">旧密码：</td>
				<td class="autd2"><input name="agent.password" id="password" type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span></td>
				<td class="autd1">新密码：</td>
				<td class="autd2"><input name="npassword" id="npassword" type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span></td>
				</tr>
				<tr>
				<td class="autd1">确认密码：</td>
				<td class="autd2"><input name="userPwd1" id="userPwd1" type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span>
				<span style=display:none id="passwordfail"><font color="red">两次输入密码不一致</font></span>
				</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				</tr>
				<tr>
				</tr>
				
			</table>
		</div>
	</div>
	
	
	<div class="btn_div">
		<a id="btn-add" onclick="clearUp();" class="easyui-linkbutton" iconCls="icon-cancel">重填</a>&nbsp;
		<a id="btn-add" onclick="update();" class="easyui-linkbutton" iconCls="icon-save">修改</a>
	</div>
</div>
</form>
</body>

</html>
